/*
 * Filename    : State_Menu_Credit.java
 * Projectname : RamaShinta
 * Date        : Nov 19, 2012 , 11:36:42 AM 
 * 
 * Class for Menu Credit
 */

package com.amikomgamedev.ramashinta.state;

import com.amikomgamedev.ramashinta.Utils;

import android.view.KeyEvent;

public class State_Menu_Credit extends State_Loading_Screen
{
	protected void create_Menu_Credit()
	{
		graphic.attachCreditBg();
		text.attachCredit();
		graphic.spr_Credit_Bg.attachChild(text.credit);

		text.credit.setPosition(RES_WIDTH / 2 - text.credit.getWidth() / 2, Utils.getRatioH(380));
		text.credit.setScale(2);
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event)
	{
		if (State_Menu_Current == STATE_MENU_CREDIT)
		{
			if (keyCode == KeyEvent.KEYCODE_BACK)
			{
				graphic.detachCreditBg();
				text.detachTextCredit();
				switchState(STATE_MENU_MAIN);
			}
		}
		return super.onKeyDown(keyCode, event);
	}
}
